package com.tudouji.project.product.controller;

import com.tudouji.framework.web.controller.BaseController;
import com.tudouji.framework.web.domain.AjaxResult;
import com.tudouji.project.product.service.IProductsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * @author xxl
 * @date 2020-12-28
 */
@RestController
@RequestMapping("/products")
public class ProductsController extends BaseController {
    @Autowired
    private IProductsService productsService;

    /**
     * @Description: 销售产品获取
     * @Author: xiaxl
     * @Date:
     * @Param:
     * @return:
     **/
    @GetMapping("/getProducts")
    public AjaxResult getProducts(Integer type,String productflag){
        return AjaxResult.success(productsService.getProducts(type,productflag));
    }
    @GetMapping("/getSpes")
    public AjaxResult getSpes(Long deptId, Integer type, Integer valuation, String productId){
        return AjaxResult.success(productsService.getSpes(deptId,type,valuation,productId));
    }

    /**
     * 获取规价格
     */
    @GetMapping("/getPrice")
    public AjaxResult getPrice(String speId,Integer currency,Integer valuation){
        return productsService.getPrice(speId,currency,valuation);
    }
}
